package basics.files;
import java.io.File;
 
public class OpenAFile
{
	public static void main(String[] args) {
		try {

			if ((new File("/Users/PengChen/Documents/random/index.html")).exists()) {
				System.out.println("opening the file...");
				Process p = Runtime
				   .getRuntime()
				   .exec("open /Users/PengChen/Documents/random/index.html");
				p.waitFor();
			} else {
				System.out.println("File does not exists");
			}
	 
			System.out.println("Done");
	 
	  	  } catch (Exception ex) {
			ex.printStackTrace();
		  }
	}
}